using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_itemCategMap : EntityTypeConfiguration<so_itemCateg>
    {
        public so_itemCategMap()
        {
            // Primary Key
            this.HasKey(t => t.Item_category);

            // Properties
            this.Property(t => t.Item_category)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.Item_type)
                .HasMaxLength(25);

            // Table & Column Mappings
            this.ToTable("so_itemCateg");
            this.Property(t => t.Item_category).HasColumnName("Item_category");
            this.Property(t => t.Item_type).HasColumnName("Item_type");
            this.Property(t => t.Count_).HasColumnName("Count_");
        }
    }
}
